import { get, post } from '../base/request';

// 年度目标详情
export const getTargetDetail = (club_id, year) => get('/api/target/detail', { club_id, year });

// 添加年度目标
export const postTargetAdd = (data) => post('/api/target/add', data);

// 修改年度目标
export const postTargetUpdate = (data) => post('/api/target/profile', data);

// 核实事件
export const postTargetVerify = (data) => post('/api/target/verify', data);

// 获取每月必做事件
export const getMonthEvents = (club_id, year) => get('/api/target/monthly_events', { club_id, year });

// 获取每月必做事件导出url
export const getMonthEventExportUrl = (club_id, year) => get('/api/target/outport', { club_id, year });

// 获取员工业绩分页列表
export const getEmployeeRecordList = (employee_id, page) => get('/api/target/performance_record', { employee_id, page });

// 员工业绩详情
export const getEmployeeDetail = (employee_id) => get('/api/target/employee_detail', { employee_id });

// 添加员工业绩
export const postEmployeeAdd = (data) => post('/api/target/add_record', data);

// 删除员工业绩记录
export const deleteEmployeeRecord = (record_id) => post('/api/target/del_record', { record_id });

// 部门管理 - 获取部门列表
export const getDepartmentList = (club_id) => get('/api/department/lists', { club_id });

// 部门管理 - 添加/保存部门
export const postDepartmentAdd = (data) => post('/api/department/profile', data);

// 计划管理 - 获取计划列表
export const getPlanList = () => get('/api/plan/lists');

// 计划管理 - 添加/保存计划
export const postPlanAdd = (data) => post('/api/plan/profile', data);

// 经营规划 - 获取经营规划列表
export const getBusinessPlanDetail = (club_id, year) => get('/api/target/business_planning', { club_id, year });

// 经营规划 - 获取经营规划导出url
export const getBusinessPlanExportUrl = (club_id, year) => get('/api/target/business_outport', { club_id, year });

// 经营规划 - 添加/保存经营规划
export const postBusinessPlanAdd = (data) => post('/api/target/profile_business_planning', data);

// 团队规划 - 获取团队规划列表
export const getTeamPlanDetail = (club_id, year) => get('/api/target/team_planning', { club_id, year });

// 团队规划 - 添加/保存团队规划
export const postTeamPlanAdd = (data) => post('/api/target/profile_team_planning', data);

// 客户规划 - 获取团队规划列表
export const getCustomerPlanDetail = (club_id, year) => get('/api/target/customer_planning', { club_id, year });

// 客户规划 - 添加/保存团队规划
export const postCustomerPlanAdd = (data) => post('/api/target/profile_customer_planning', data);

// 营销规划 - 获取营销规划列表
export const getMarketPlanDetail = (club_id, year) => get('/api/target/market_planning', { club_id, year });

// 营销规划 - 添加/保存营销规划
export const postMarketPlanAdd = (data) => post('/api/target/profile_market_planning', data);

// 供应链规划 - 获取产品详情
export const getProductDetail = (club_id, year) => get('/api/target/product', { club_id, year });

// 供应链规划 - 添加/保存产品
export const postProductAdd = (data) => post('/api/target/profile_product', data);

// 供应链规划 - 供应商列表
export const getSupplierList = (club_id, year) => get('/api/supplier/lists', { club_id, year });

// 供应链规划 - 供应商详情
export const getSupplierDetail = (supplier_id) => get('/api/supplier/detail', { supplier_id });

// 供应链规划 - 添加供应商
export const postSupplierAdd = (data) => post('/api/supplier/add', data);

// 供应链规划 - 编辑供应商
export const postSupplierEdit = (data) => post('/api/supplier/edit', data);

// 供应链规划 - 删除供应商
export const deleteSupplier = (supplier_id) => post('/api/supplier/del', { supplier_id });

// 供应链规划 - 获取负责人
export const getChargeDetail = (club_id, year) => get('/api/supplier/get_charge', { club_id, year });

// 供应链规划 - 保存负责人
export const postChargeAdd = (data) => post('/api/supplier/set_charge', data);

// 团建规划 - 获取团建规划列表
export const getTeamBuildList = (club_id, year, page) => get('/api/construction/lists', { club_id, year, page });

// 团建规划 - 获取团建规划详情
export const getTeamBuildDetail = (construction_id) => get('/api/construction/detail', { construction_id });

// 团建规划 - 获取负责人
export const getTeamBuildCharge = (club_id, year) => get('/api/construction/get_charge', { club_id, year });

// 团建规划 - 新增团建规划
export const postTeamBuildAdd = (data) => post('/api/construction/add', data);

// 团建规划 - 编辑团建规划
export const postTeamBuildEdit = (data) => post('/api/construction/edit', data);

// 团建规划 - 删除团建规划
export const deleteTeamBuild = (construction_id) => post('/api/construction/del', { construction_id });

// 团建规划 - 保存负责人
export const postTeamBuildChargeAdd = (club_id, year, construction_planning_charge) => post('/api/construction/set_charge', { club_id, year, construction_planning_charge });

// 修改员工业绩记录
export const postEditRecord = (data) => post(`/api/target/edit_record?employee_id=${data.employee_id}`,data);